Imports System

Namespace BasicSystem
    Public Class Info

        Public Function GetProcessorArchitecture() As String
            Dim ret As String = Environment.GetEnvironmentVariable("PROCESSOR_ARCHITECTURE")
            Return ret
        End Function
        Public Function GetProcessorArchiteW6432() As String
            Dim ret As String = Environment.GetEnvironmentVariable("PROCESSOR_ARCHITEW6432")
            Return ret
        End Function

        Public Function getWMIInfo(ByVal wmiObjectInfo As String, ByVal wmiRelativePath As String) As String

            Try
                '
                'Give it something to report in case something wrong happens.
                getWMIInfo = "Nothing!" '

                Dim wmiClass As New Management.ManagementClass

                Dim wmiObject As New Management.ManagementObject

                wmiClass.Path.RelativePath = wmiRelativePath
                '
                'This will go through each item in the requested info. I only care about
                'the 1st for the most part but remeber that each instance could have different values.
                For Each wmiObject In wmiClass.GetInstances

                    getWMIInfo = (wmiObject(wmiObjectInfo))
                    '
                    'I only want the first instance.

                    Return getWMIInfo

                Next

            Catch exc As Exception

                Return exc.Message

            End Try

        End Function

    End Class
End Namespace
